package Day1;

import java.util.Scanner;

public class workPro {
    public static void main(String[] args) {
        int [] n=new int[5];
        workPro.input(n);
        workPro.paixu(n);
        workPro.output(n);
    }
    public static void input(int[]n) {
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            System.out.println("请输入第"+(i+1)+"个连续的数组数据");
            n[i]=scanner.nextInt();

        }
    }
    public static void output(int[]n) {
        System.out.println("排列后的顺序是：");
        for (int i = 0; i < 5; i++) {
            System.out.print(" "+n[i]);
        }
    }
    public static void paixu(int[]n) {
        int r=0;
        for (int i = 0; i < n.length-1; i++) {
            for (int j = 0; j < n.length-1-i; j++) {
                if (n[j]<n[j+1]){
                    r=n[j];
                    n[j]=n[j+1];
                    n[j+1]=r;
                }
            }
        }

    }
}
